<script setup lang="ts">
import useTodoStore from '../../stores/modules/todo'
const todoStore = useTodoStore()
console.log('pinia -->', todoStore.list)

const handleTap = () => {
  return todoStore.pushListItem(4)
}
</script>

<template>
  <div style="background: skyblue; margin-top: 50px">
    <div style="background: red">子组件2：使用组合式API：</div>
    <button @click="handleTap">触发pushListItem函数，数组元素增加</button>
    <h1>类似于state的属性list：{{ todoStore.list }}</h1>
    <h1>类似于getters的属性totle： {{ todoStore.totle }}</h1>
  </div>
</template>

<style scoped></style>
